// pages/more-videos/more-videos.js
const app = getApp();
Page({
  data: {
    NoticeList: {} // 
  },
  onLoad: function () {
      wx.request({
        url: `${app.globalData.baseUrl}/api/index/Notice`,
        method: 'GET',
        success: (res) => {
          if (res.statusCode === 200) {
        this.setData({
          NoticeList: res.data.data,
        });
          } else {
            wx.showToast({ title: '加载失败', icon: 'error' });
          }
        },
        fail: (err) => {
          console.error('请求失败:', err);
          wx.showToast({ title: '网络错误', icon: 'error' });
          }
      });
    },
    viewNotice(e) {
      const { id } = e.currentTarget.dataset;
      wx.navigateTo({
        url: `/pages/index/more-notice/notice-detail/notice-detail?id=${id}`
      });
    }
});